package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ReportConfigMapper;
import com.ruoyi.system.domain.ReportConfig;
import com.ruoyi.system.service.IReportConfigService;

/**
 * 报表配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-23
 */
@Service
public class ReportConfigServiceImpl implements IReportConfigService 
{
    @Autowired
    private ReportConfigMapper reportConfigMapper;

    /**
     * 查询报表配置
     * 
     * @param id 报表配置主键
     * @return 报表配置
     */
    @Override
    public ReportConfig selectReportConfigById(Long id)
    {
        return reportConfigMapper.selectReportConfigById(id);
    }

    /**
     * 根据报表编码查询报表配置
     * 
     * @param reportCode 报表编码
     * @return 报表配置
     */
    @Override
    public ReportConfig selectReportConfigByCode(String reportCode)
    {
        return reportConfigMapper.selectReportConfigByCode(reportCode);
    }

    /**
     * 查询报表配置列表
     * 
     * @param reportConfig 报表配置
     * @return 报表配置
     */
    @Override
    public List<ReportConfig> selectReportConfigList(ReportConfig reportConfig)
    {
        return reportConfigMapper.selectReportConfigList(reportConfig);
    }

    /**
     * 新增报表配置
     * 
     * @param reportConfig 报表配置
     * @return 结果
     */
    @Override
    public int insertReportConfig(ReportConfig reportConfig)
    {
        reportConfig.setCreateTime(DateUtils.getNowDate());
        return reportConfigMapper.insertReportConfig(reportConfig);
    }

    /**
     * 修改报表配置
     * 
     * @param reportConfig 报表配置
     * @return 结果
     */
    @Override
    public int updateReportConfig(ReportConfig reportConfig)
    {
        reportConfig.setUpdateTime(DateUtils.getNowDate());
        return reportConfigMapper.updateReportConfig(reportConfig);
    }

    /**
     * 批量删除报表配置
     * 
     * @param ids 需要删除的报表配置主键
     * @return 结果
     */
    @Override
    public int deleteReportConfigByIds(Long[] ids)
    {
        return reportConfigMapper.deleteReportConfigByIds(ids);
    }

    /**
     * 删除报表配置信息
     * 
     * @param id 报表配置主键
     * @return 结果
     */
    @Override
    public int deleteReportConfigById(Long id)
    {
        return reportConfigMapper.deleteReportConfigById(id);
    }
}
